<template>
    <p></p>
    <nut-button type="primary" @click="linkToDetail()">点击跳转到xx页面</nut-button>
    <nut-button type="primary" @click="linkToTab()">点击跳转到tab页面</nut-button>
    <img class="index-img" src="https://cdn.krisli.cn/imgs/Rectangle%2046.png" alt="" srcset="" />
</template>

<script setup>
import Taro from '@tarojs/taro'

const linkToDetail = () => {
    console.log('跳转')
    // Taro.navigateTo({
    //     url: `/pages/product/detail/index?id=${product.id}`
    // })
}
const linkToTab = () => {
    console.log('跳转')
    Taro.switchTab({
        url: '/pages/index/index'
    })
}
</script>

<style lang="less">
.index-img {
    width: 750px;
    height: 1600px;
}
</style>
